// 根据mutation 来修改 state的值，类似与 redux的 reducer
export const ADD_COMMENT = (state, comment) => {
    state.comments = [...state.comments, comment];
    return state.comments;
};
export const DELETE_COMMENT = (state, index) => {
    state.comments = [...state.comments.slice(0, index), ...state.comments.slice(index + 1)];
    return state.comments;
};
